package wymiana.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Type;

@Entity
@Table(name = "group_request")
public class GroupRequest extends BaseEntity {

	/** serialization uid */
	private static final long serialVersionUID = -1495580095607554444L;
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(updatable = false, name = "GROUP_REQUEST_ID")
	private Integer idGroupRequest;

	@ManyToOne
	@JoinColumn(name = "dgroup", nullable = true)
	private DGroup dgroup;

	@ManyToOne
	@JoinColumn(name = "askingUser", nullable = true)
	private User askingUser;

	@Type(type = "org.hibernate.type.NumericBooleanType")
	@Column(nullable = false)
	private Boolean accepted;

	/**
	 * @return the idGroupRequest
	 */
	public Integer getIdGroupRequest() {
		return idGroupRequest;
	}

	/**
	 * @param idGroupRequest
	 *            the idGroupRequest to set
	 */
	public void setIdGroupRequest(Integer idGroupRequest) {
		this.idGroupRequest = idGroupRequest;
	}

	/**
	 * @return the askingUser
	 */
	public User getAskingUser() {
		return askingUser;
	}

	/**
	 * @param askingUser
	 *            the askingUser to set
	 */
	public void setAskingUser(User askingUser) {
		this.askingUser = askingUser;
	}

	/**
	 * @return the accepted
	 */
	public Boolean getAccepted() {
		return accepted;
	}

	/**
	 * @param accepted
	 *            the accepted to set
	 */
	public void setAccepted(Boolean accepted) {
		this.accepted = accepted;
	}

	/**
	 * @return the dgroup
	 */
	public DGroup getDgroup() {
		return dgroup;
	}

	/**
	 * @param dgroup
	 *            the dgroup to set
	 */
	public void setDgroup(DGroup dgroup) {
		this.dgroup = dgroup;
	}
}
